﻿/*
 * MessageSerializer
 * 
 * Convert byte[] to object and object to byte[]
 * 
 * Author: snowdreamist
 * Date: 2011/11/24
 * 
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BitTorrentSharp.BEncoding;
using BitTorrentSharp.KRPC.Contract;

namespace BitTorrentSharp.KRPC.Messages
{
    public interface IMessageSerializer
    {
        /// <summary>
        /// Serialize
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        BValue Serialize(object obj, DataContractWrapper targetTypeWrapper, MessageContext context);
        /// <summary>
        /// Deserialize
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        object Deserialize(BValue value, DataContractWrapper targetTypeWrapper, MessageContext context);
    }
}
